import { useModel } from '@@/plugin-model/useModel';
import styles from './index.less';
import { Avatar } from 'antd-mobile';

export default (props: any) => {
  const { config } = useModel('config');

  const open = (url: string) => {
    props.history.push(url);
  };

  return (
    <div className={styles.workplace}>
      {config?.workplace.shortcuts.map((shortcut: any) => (
        <div className={styles.shortcuts} onClick={() => open(shortcut.path)}>
          <Avatar className={styles.logo} src="{shortcut.path}" />
          {shortcut.name}
        </div>
      ))}
    </div>
  );
};
